# 简单弹性测试 - 验证GPU基本功能
wipe
model basic -ndm 2 -ndf 2

# 创建材料：使用弹性材料
nDMaterial ElasticIsotropic 1 30.0e9 0.2

# 创建节点
node 1 0.0 0.0
node 2 1.0 0.0
node 3 1.0 1.0
node 4 0.0 1.0

# 固定边界
fix 1 1 1
fix 2 1 1

# 创建单元
set thickness 1.0
element quad 1 1 2 3 4 $thickness "PlaneStress" 1

# 施加荷载
pattern Plain 1 "Linear" {
    load 3 1000.0 0.0
    load 4 1000.0 0.0
}

# 分析设置
constraints Plain
numberer RCM
system GPUSolver
test NormDispIncr 1.0e-6 20 0
algorithm Newton
integrator LoadControl 0.1
analysis Static

# 运行分析
puts "\n========== 开始GPU弹性分析 =========="
set ok [analyze 1]
if {$ok == 0} {
    puts "✅ GPU弹性分析成功"
    puts "节点3位移: [nodeDisp 3 1] [nodeDisp 3 2]"
    puts "节点4位移: [nodeDisp 4 1] [nodeDisp 4 2]"
} else {
    puts "❌ GPU弹性分析失败"
}
wipe
